// 3.封装网络请求api层
// 1.引入配置文件中的getData postData
import {
    getData,
    postData
} from "./config.js"

// 2.封装首页api层方法并导出（此接口仅供测试）
export const reqGetCate = () => getData('/api/getcate')
//------------------------------------------------
// 3.封装登录api层方法并导出
export const reqlogin = (params) => postData('/api/userlogin', params)
//------------------------------------------------
// 4.获取菜单类表数据
export const reqGetMenu = params => getData('/api/menulist', params)
// 添加菜单类表数据
export const reqAddMenu = params => postData('/api/menuadd', params)
// 修改菜单类表数据
export const reqEditMenu = params => postData('/api/menuedit', params)
// 删除菜单类表数据
export const reqRemoveMenu = params => postData('/api/menudelete', params)
//------------------------------------------------
// 5.获取角色类表数据
export const reqGetRole = params => getData('/api/rolelist', params)
// 添加角色类表数据
export const reqAddRole = params => postData('/api/roleadd', params)
// 删除角色类表数据
export const reqRemoveRole = params => postData('/api/roledelete', params)
// 修改角色类表数据
export const reqEditRole = params => postData('/api/roleedit', params)
//------------------------------------------------
// 6.获取管理员类表数据(总数)
export const reqGetUserCount = () => getData('/api/usercount')
// 获取管理员类表数据
export const reqGetUser = (params) => getData('/api/userlist', params)
// 添加管理员类表数据
export const reqAddUser = (params) => postData('/api/useradd', params)
// 管理员删除
export const reqRemoveUser = (params) => postData('/api/userdelete', params)
// 管理员修改
export const reqEditUser = (params) => postData('/api/useredit', params)
//------------------------------------------------
// 7.获取商品分类类表数据
export const reqGetCates = (params) => getData('/api/catelist', params)
// 添加商品分类类表数据
export const reqAddCates = (params) => postData('/api/cateadd', params)